/**
 *
 * @param pagination
 * @param entities
 * @param key
 * @returns {any[]}
 */
const getListFromEntitiesByKey = (pagination, entities, key) => {
  const entityPagination = pagination[key] || {ids: []}
  return entityPagination.ids.map(id => entities[id])
}

export {
  getListFromEntitiesByKey
}
